package net.asrsmid.connection;

import org.apache.commons.pool.PoolableObjectFactory;
import org.apache.commons.pool.impl.GenericObjectPool;

/**
 * @author Chen WANG
 * @since 23 June 2011
 */
public class AsRsConnectionPool extends GenericObjectPool {
	String poolId;
	
	public AsRsConnectionPool(PoolableObjectFactory fac, String poolId) {
		super(fac);
		this.poolId = poolId;
	}
	
	public AsRsPoolableConnection borrowObject() {
		AsRsPoolableConnection obj = null;
		try {
			obj = (AsRsPoolableConnection) super.borrowObject();
			obj.register(this);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return obj;
	}
}
